<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //某公司 1 到 12 月份的销售额存在一个对象里面，如下：{1:222, 2:123, 5:888}，请把数据处理为如下结构：[222, 123, null, null, 888, null, null, null, null, null, null, null]
        let obj = {1:222,2:123,5:888};  
         
     let cc =  [...Array(12).keys()].map(x=>{
          if(obj[x+1]) {
              x=obj[x+1]
          } else {
              x=null
          }
          return x
      })
      
      let dd = [...Array(12).keys()].map(x=> obj[x+1]||null)
      console.log(cc)
      console.log(dd)
    </script>
</body>
</html>